package com.woniuxy.feign;

import com.woniuxy.feign.hystrix.GoodsHystrix;
import com.work.framework.pojo.Auction;
import com.work.framework.pojo.GoodsAuctionDTO;
import com.work.framework.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
 * @Author: wanghao
 * @Date: 2019/9/18 15:12
 *
 * goods商品远端调用
 */

@FeignClient(value = "goods-server",fallback = GoodsHystrix.class)
public interface GoodsFeign {

    /**
     * 查询商品卖家
     *
     * @param aid
     * @return
     */
    @GetMapping("buyer/selectGoodsAndAuctionByAid/{aid}")
    GoodsAuctionDTO selectGoodsAndAuctionByAid(@PathVariable("aid") Integer aid);

    /**
     * 查询参与此商品竞拍表的信息
     * @param aid
     * @return
     */
    @GetMapping("/buyer/auction/{aid}")
    Auction selectAuction(@PathVariable("aid") Integer aid);

    /**
     * 查询收藏此商品的
     * @param gid
     * @return
     */
    @GetMapping("/buyer/selectUsers/{gid}")
    List<User> selectUsers(@PathVariable("gid") Integer gid);



    /**
     * 修改商品的状态
     */
    @GetMapping("/buyer/updateStatus/{aid}/{status}")
    Boolean updateAuctionStatus(@PathVariable("aid") Integer aid,@PathVariable("status") Integer status);
}
